<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="UTF-8">
  <head>
  <%@include file="/WEB-INF/include-head.jsp" %>
  <script type="text/javascript">
  $(function(){
	 $("#leftTo").click(function(){
		 //定位到select具体选中的子元素中
		 $("#leftSelect>option:selected").appendTo("#rightSelect");
	 }); 
	 $("#rightTo").click(function(){
		 $("#rightSelect>option:selected").appendTo("#leftSelect")
	 });
	 $("#subtn").click(function(){
		 $("#rightSelect>option").prop("selected","selected");
	 });
  });
  </script>
  </head>
  <body>
	<!-- nav -->
	<%@include file="/WEB-INF/include-nav.jsp" %>
    <div class="container-fluid">
      <div class="row">
        <%@include file="/WEB-INF/include-sidebar.jsp" %>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        
          <ol class="breadcrumb">
				  <li><a href="admin/to/main.html">首页</a></li>
				  <li><a href="admin/query/for/search.html?pageNum=${param.pageNum }">数据列表</a></li>
				  <li class="active">分配角色</li>
				</ol>
			<div class="panel panel-default">
			  <div class="panel-body">
				<form role="form" class="form-inline" action="assign/reAssignRole.html">
				<input type="hidden" name="adminid" value="${param.adminid }"/>
				<input type="hidden" name="pageNum" value="${param.pageNum }"/>
				  <div class="form-group">
					<label for="exampleInputPassword1">未分配角色列表</label><br>
					<select id="leftSelect" class="form-control" multiple size="10" style="width:100px;overflow-y:auto;">
                        <c:forEach items="${unassignRole }" var="unrole">
                        <option value="${unrole.id }">${unrole.name }</option>
                        </c:forEach>
                    </select>
				  </div>
				  <div class="form-group">
                        <ul>
                            <a id="leftTo"><li class="btn btn-default glyphicon glyphicon-chevron-right"></li></a>
                            <br>
                            <a id="rightTo"><li class="btn btn-default glyphicon glyphicon-chevron-left" style="margin-top:20px;"></li></a>
                        </ul>
				  </div>
				  <div class="form-group" style="margin-left:40px;">
					<label for="exampleInputPassword1">已分配角色列表</label><br>
					<select id="rightSelect" name="listRoleid" class="form-control" multiple size="10" style="width:100px;overflow-y:auto;">
                        <c:forEach items="${assignRole }" var="role">
                        <option value="${role.id }">${role.name }</option>
                        </c:forEach>
                    </select>
				  </div>
				  <div style="clear:both;"></div>
				  <br>
				  <button id="subtn" type="submit" class="btn btn-primary" style="width:100px;"><i class="glyphicon glyphicon-plus"></i> 分配</button>
				</form>
			  </div>
			</div>

        </div>
      </div>
    </div>

  </body>
</html>